package com.swanclouds.redfish.chassis.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.model.chassis.Thermal;

import java.util.List;
import java.util.Map;


/**
 *  * Description:
 *  * Author:      zhangliqiang@asiacom.net.cn
 *  * Date:        2022-07-17 11:26.
 *  
 */
public class ThermalModel implements Thermal {

    /**散热资源的访问路径**/
    @JsonProperty("@odata.id")
    private String dataId;

    /**散热资源模型的OData描述信息**/
    @JsonProperty("@odata.context")
    private String context;

    /**散热资源的类型**/
    @JsonProperty("@odata.type")
    private String type;

    /**散热资源的描述**/
    @JsonProperty("Description")
    private String description;

    /**散热资源ID**/
    @JsonProperty("Id")
    private String id;

    /**散热资源名称**/
    @JsonProperty("Name")
    private String name;

    /**散热资源自定义信息**/
    @JsonProperty("Oem")
    private Map<String, Object> oem;

    /**指定风扇传感器的信息**/
    @JsonProperty("FanSummary")
    private Map<String, String> fanSummary;

    /**风扇传感器列表**/
    @JsonProperty("Fans")
    private List<Fans> fans;

    /**温度传感器列表**/
    @JsonProperty("Temperatures")
    private List<Temperatures> temperatures;

    /**
     * 可执行的操作
     */
    @JsonProperty("Actions")
    private Map<String,Object> action;

    @Override
    public String getDataId() {
        return this.dataId;
    }

    @Override
    public String getContext() {
        return this.context;
    }

    @Override
    public String getType() {
        return this.type;
    }

    @Override
    public String getId() {
        return this.id;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public String getDescription() {
        return description;
    }

    public Map<String,Object> getOem() {
        return oem;
    }

    public Map<String, String> getFanSummary() {
        return fanSummary;
    }

    public List<Fans> getFans() {
        return fans;
    }

    public List<Temperatures> getTemperatures() {
        return temperatures;
    }

    public Map<String, Object> getAction() {
        return action;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "ThermalModel {" +
                "dataId='" + dataId + '\'' +
                ", context='" + context + '\'' +
                ", type='" + type + '\'' +
                ", description='" + description + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", oem=" + oem +
                ", fanSummary=" + fanSummary +
                ", fans=" + fans +
                ", temperatures=" + temperatures +
                ", action=" + action +
                '}';
    }

}
